{
  "openapi": "3.0.1",
  "info": {
    "title": "Planning Certificate 10.7 - Councils to ePlanning API",
    "description": "# Authentication    \n\nPlease use the subscription key provided by the Department to access the APIs.\n",
    "contact": {},
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.apps1.nsw.gov.au/planning/OnlinePlanningCert/v1"
    }
  ],
  "paths": {
    "/AcceptReturn/{CaseID}": {
      "put": {
        "summary": "AcceptReturn",
        "description": "This operation transfers the council�s decision to either proceed or not proceed with the Planning Certificate 10.7 request from council�s IT system to the Online Section 10.7 Planning Certificate Service. This operation replicates the action performed on the  Completeness Check screen in UI.",
        "operationId": "put-AcceptReturn-caseid",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified Portal application number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "The council LGA name or Private Certifier Organisation name to indicate where the request is originated from.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyID",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptReturn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Case updated",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Case not found or locked by another user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-codegen-request-body-name": "body"
      }
    },
    "/Issuance/{CaseID}": {
      "put": {
        "summary": "Issuance",
        "description": "This operation transfers the council�s decision to Issue or not issue the 10.7 Certificate from their IT system to Online Planning Certificate 10.7 Service.",
        "operationId": "put-Issuance-caseid",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified Portal application number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "The council LGA name or Private Certifier Organisation name to indicate where the request is originated from.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Determination request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Issuance"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Case updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Case not found or locked by another user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "Issuance": {
        "title": "Issuance",
        "required": [
          "certificateStatus",
          "updatedByEmail"
        ],
        "type": "object",
        "properties": {
          "certificateStatus": {
            "$ref": "#/components/schemas/CertificateIssuanceOutcome"
          },
          "certificateIssuedDate": {
            "type": "string",
            "description": "Certificate issued date. Mandatory  when The certificate has been :\"Issued\"",
            "format": "date",
            "example": "2020-09-10"
          },
          "certificateRejectReason": {
            "type": "string",
            "description": "The reason council is not issued Certificate. Only required if The certificate has been :'Not Issued'"
          },
          "Documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "updatedByEmail": {
            "$ref": "#/components/schemas/UpdatedByEmail"
          }
        }
      },
      "AcceptReturn": {
        "title": "AcceptReturn",
        "required": [
          "outcomeOfReview",
          "updatedByEmail"
        ],
        "type": "object",
        "properties": {
          "outcomeOfReview": {
            "$ref": "#/components/schemas/ReviewOfOutcome"
          },
          "isFeePaid": {
            "type": "string",
            "description": "Applicant paid the relevant fees. Mandatory  when What is the outcome of your review? equals to:\"Proceed with certificate request\"",
            "enum": [
              "Yes",
              "No"
            ]
          },
          "feeAmount": {
            "type": "number",
            "description": "Total fee paid. Mandatory  when Applicant paid the relevant fees? equals to:\"Yes\"",
            "format": "decimal",
            "example": 1250.9
          },
          "councilUniqueIDNumber": {
            "type": "number",
            "description": "Council unique identification number. Mandatory  when daFeePaid equals to:\"Yes/No\"",
            "maxLength": 20
          },
          "feeNotPaidReason": {
            "maxLength": 512,
            "type": "string",
            "description": "provide a reason why applicant didn't paid the relevant fees. Mandatory  when Applicant paid the relevant fees equals to \"No\""
          },
          "rejectReason": {
            "maxLength": 512,
            "type": "string",
            "description": "Reason for return the applicaion by council. Mandatory  when What is the outcome of your review? is equals to \"Not proceed with certificate request\""
          },
          "rejectDate": {
            "type": "string",
            "description": "applcation rejected date by council. Mandatory  when What is the outcome of your review? is equals to \"Not proceed with certificate request\"",
            "format": "date",
            "example": "2020-12-30"
          },
          "updatedByEmail": {
            "$ref": "#/components/schemas/UpdatedByEmail"
          }
        }
      },
      "DocResponse": {
        "title": "DocResponse",
        "type": "object",
        "properties": {
          "documentName": {
            "type": "string",
            "description": "documentName which was uploaded as part of respective API opeartion",
            "example": "test.docx"
          },
          "documentType": {
            "type": "string",
            "description": "Type of Document under which repsective document was uploaded"
          },
          "eplanningDocId": {
            "type": "string",
            "description": "DocId of the respective document which was uploaded"
          },
          "externalOrgDocURL": {
            "type": "string",
            "description": "URL of the document which was uploaded"
          }
        }
      },
      "DownloadableDocument": {
        "title": "DownloadableDocument",
        "required": [
          "documentName",
          "documentType",
          "documentURL",
          "uploadedDateTime"
        ],
        "type": "object",
        "properties": {
          "documentName": {
            "maxLength": 150,
            "type": "string",
            "description": "documentName has to be appended with file extension",
            "example": "test.docx"
          },
          "documentType": {
            "maxLength": 100,
            "type": "string"
          },
          "uploadedDateTime": {
            "type": "string",
            "format": "date-time"
          },
          "documentURL": {
            "maxLength": 500,
            "type": "string",
            "description": "URL of the document to be downloaded"
          }
        }
      },
      "UpdatedByEmail": {
        "title": "UpdatedByEmail",
        "type": "string",
        "description": "user mail address who performing the action."
      },
      "CertificateIssuanceOutcome": {
        "title": "The certificate has been",
        "type": "string",
        "description": "The certificate has been, Issued or Not Issued. One of the below mentioned values must be selected for CertificateIssuanceOutcome 1. Issued 2. Not Issued",
        "example": "Refer to description for values"
      },
      "ReviewOfOutcome": {
        "title": "ReviewOfOutcome",
        "type": "string",
        "description": "What is the outcome of your review, Proceed with certificate request or Not proceed with certificate request. One of the below mentioned values must be selected for ReviewOfOutcome 1. Proceed with certificate request 2. Not proceed with certificate request",
        "example": "Refer to description for values"
      },
      "Response": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 200
          },
          "message": {
            "type": "string"
          },
          "activityId": {
            "type": "string"
          },
          "Documents": {
            "type": "array",
            "description": "Attached documents with eplanningDocIds.",
            "items": {
              "$ref": "#/components/schemas/DocResponse"
            }
          }
        }
      },
      "Error": {
        "title": "Error",
        "required": [
          "errorCode",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32",
            "example": 404
          },
          "message": {
            "type": "string",
            "example": "Internal Server error 19876"
          },
          "activityId": {
            "type": "string",
            "example": "00000011-0ab-xy00-0000-500000000000"
          },
          "errorCode": {
            "type": "string",
            "example": "DPE_TMS01"
          },
          "errorDetails": {
            "type": "string",
            "example": "Inner Exceptions, Stack Trace, etc"
          }
        }
      }
    }
  }
}